-module(recursive_update).

-include_lib("ect/include/ect.hrl").

-import_class(pattern1).
-import_class(pattern2).


-export([dotest/0]).

dotest() ->
    #pattern2{a = xa, b = xb, c = #pattern2{b = 5}} = a(#pattern2{c = #pattern2{b = 6}}),
    pass.

a(#pattern1{} = A) ->
    A#pattern1{c = (A#pattern2.c)#pattern1{b = 5}, a = xa, b = xb}.